function* gen(arg) {
  console.log(arg); //aaa
  let one = yield 1;
  console.log(one); //BBB
  let two = yield 2;
  console.log(two); //CCC
  let three = yield 3;
  console.log(three); //DDD
  let four = yield 4;
  console.log(four); //EEE
}

let iterator = gen('aaa'); //?传给arg
// ?next方法可以传入实参,这个实参就是整个yield语句的返回结果
console.log(iterator.next('AAA'));
console.log(iterator.next('BBB')); //?传给第一个yield
console.log(iterator.next('CCC')); //?传给第二个yield
console.log(iterator.next('DDD')); //?传给第三个yield
console.log(iterator.next('EEE')); //?传给第四个yield